﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;

namespace MxTol.Models
{
    /// <summary>
    /// 会计基础判断题题库实体类
    /// </summary>
    [ActiveRecord(Table = "Ba_Judge")]
    public class BaJudge : ActiveRecordBase
    {
        /// <summary>
        /// 题目主键
        /// </summary>
        [PrimaryKey("id")]
        public Guid ID { get; set; }

        /// <summary>
        /// 题目标题
        /// </summary>
        [Property("title")]
        public string Title { get; set; }

        /// <summary>
        /// 正确答案  0:错误 1：正确
        /// </summary>
        [Property("answer_key")]
        public byte Answer { get; set; }

        /// <summary>
        /// 答案解析 没有则表示：略
        /// </summary>
        [Property("analysis")]
        public string Analysis { get; set; }

        /// <summary>
        /// 题目添加入
        /// </summary>
        [Property("add_person")]
        public string AddPerson { get; set; }

        /// <summary>
        /// 该条记录添加时间
        /// </summary>
        [Property("add_time")]
        public DateTime AddTime { get; set; }

        /// <summary>
        /// 根据主键获取判断题
        /// </summary>
        public static BaJudge GetJudgeByID(Guid id)
        {
            BaJudge judge = (BaJudge)FindByPrimaryKey(typeof(BaJudge), id);
            if (judge != null)
            {
                return judge;
            }
            else
            {
                return null;
            }
        }
    }
}
